import TodoFooter from './moduls/TodoFooter'
import TodoHearder from './moduls/TodoHearder'
import TodoMain from './moduls/TodoMain'
import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex)
export default new Vuex.Store({
    modules: {
        TodoFooter,
        TodoHearder,
        TodoMain
    },
    getters: {
        getInfoInputList: (state) => state.main.infoList,
        setInputFalg: (state) => state.main.infoList.every(item => item.falg === true),
        delTrueItem: (state) => state.main.infoList.filter(item => item.falg !== true),
    },
    plugins: [createPersistedState({
        key: 'todolist',
        paths:['main'], //指定要缓存的数据
      })] //持久化
})